<{include file='index/header.html'}>
<style type="text/css">
	.bar-nav~.content{top: 2.5rem;}
</style>
<div class="page help page-current" id="page-app-help">
	<header class="bar bar-nav common-bar-nav">
		<a class="pull-left external" href="/index/my/sign"><i class="fa fa-arrow-left"></i></a>
		<h1 class="title">签到记录</h1>
	</header>
	<{include file='index/nav.html'}>
	<div class="content">
		<div class="list-block pull-to-refresh-content infinite-scroll" data-distance="50">
			
			
			<ul id="data-list"></ul>
			<div class="infinite-scroll-preloader hide">
				<div class="preloader"></div>
			</div>
		</div>
	</div>
</div>

<script src="/static/app/js/qcing.js"></script>
<script>
$(function(){
	//无限滚动
 	$(document).on("pageInit", ".page", function(e, id, page) {
		loaddata("<{$nextpage nofilter}>",$("#data-list"),true, page);
	});

	function getLocation() {
		var map, geolocation;
		map = new AMap.Map('allmap');
		map.plugin('AMap.Geolocation', function() {
			geolocation = new AMap.Geolocation({
				enableHighAccuracy: true //是否使用高精度定位，默认:true
			});
			geolocation.getCurrentPosition();
			AMap.event.addListener(geolocation, 'complete', getPositionInfo);//返回定位信息
			AMap.event.addListener(geolocation, 'error', function(){alert('定位出错')});      //返回定位出错信息
		});
	}

	function getPositionInfo(data) {
		var point = data.position;
		$('#js-lat').html(point.lat);
		$('#js-lng').html(point.lng);
		var lnglatXY = [point.lng, point.lat]; //已知点坐标
		var map = new AMap.Map('allmap');
		map.plugin('AMap.Geocoder', function() {
			var geocoder = new AMap.Geocoder();
			geocoder.getAddress(lnglatXY, function(status, result) {
				if (status === 'complete' && result.info === 'OK') {
					var obj = result.regeocode.addressComponent;
					var position = result.regeocode.formattedAddress;
					position = position.replace(obj.province, '');
					position = position.replace(obj.district, '');
					position = position.replace(obj.city, '');
					$('#position').html(position);
				}
			});
		});
		// getStoreList();
		return ;
	}
	

	$(document).on("click", ".order-cancel", function() {
		var id = $(this).data('id');
		if(!id) {
			return false;
		}
		$.confirm('确定取消该出访吗', function(){
			$.showPreloader('系统处理中。。。');
			$.post("/index/chufang/ban", {doids: id}, function(response){
				// var result = $.parseJSON(data);
				if(response.code == 0) {
					$.toast(response.result);
				} else {
					$.toast('取消出访成功', location.href);
				}
			});
			return;
		});
	});


	$(document).on("click", ".order-status", function() {
		var id = $(this).data('id');
		if(!id) {
			return false;
		}
		var status = $(this).data('status');
		var type = $(this).data('type');
		$.confirm('确定变更出访状态吗', function(){
			$.showPreloader('系统处理中。。。');
			$.post("/index/chufang/act", {doids: id, status: status}, function(response){
				// var result = $.parseJSON(data);
				if(response.code == 0) {
					$.toast(response.result);
				} else {
					$.toast('变更出访状态成功', location.href);
				}
			});
			return;
		});
	});

	$.init();

});
</script>

<{include file='index/footer.html'}>